import axios from 'axios'
import { baseURL } from '../configFile'
import UserType from '../types/UserType'
import { Store } from 'antd/lib/form/interface'

const axiosReq = axios.create({
    baseURL
})

//分页列出用户
export const listUserInfoReq = (offset: number, limit: number) => {
    return axiosReq.get('/listUserInfo', { params: { offset, limit } })
}

//查询指定类型用户数量
export const queryUserAmount = (userType: UserType) => {
    return axiosReq.get('/queryUserAmount', { params: { userType } })
}

//搜索特定用户
export const searchUser = (keyword: string) => {
    return axiosReq.get('/searchUser', { params: { keyword } })
}

//超管登录
export const supervisorLogin = (login:Store) => {
    return axiosReq.post('/supervisorLogin',login)
}